
package jsat.graphing;

import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import javax.swing.JProgressBar;
import javax.swing.LayoutStyle.ComponentPlacement;

/**
 * Basic Progress Panel
 * @author Edward Raff
 */
public class ProgressPanel extends javax.swing.JPanel
{
    /**
     * Creates new form ProgressPanel
     */
    public ProgressPanel(String message, String note)
    {
        initComponents();
        jProgressBar.setIndeterminate(true);
        setMessage(message);
        setNote(note);
    }
    
    public void setMessage(String message)
    {
        messageLabel.setText(message);
    }
    
    public void setNote(String note)
    {
        noteLabel.setText(note);
    }

    public JProgressBar getjProgressBar()
    {
        return jProgressBar;
    }
    

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents()
    {

        jProgressBar = new JProgressBar();
        noteLabel = new JLabel();
        messageLabel = new JLabel();

        noteLabel.setText("jLabel1");

        messageLabel.setText("jLabel1");

        GroupLayout layout = new GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(Alignment.LEADING)
                    .addComponent(jProgressBar, GroupLayout.DEFAULT_SIZE, 243, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(Alignment.LEADING)
                            .addComponent(noteLabel)
                            .addComponent(messageLabel))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(Alignment.LEADING)
            .addGroup(Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(messageLabel)
                .addPreferredGap(ComponentPlacement.UNRELATED)
                .addComponent(noteLabel)
                .addPreferredGap(ComponentPlacement.RELATED)
                .addComponent(jProgressBar, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private JProgressBar jProgressBar;
    private JLabel messageLabel;
    private JLabel noteLabel;
    // End of variables declaration//GEN-END:variables
}
